<template>
    <view class="container">
        <view>
            <desc-wrapper :title="title" :desc="desc"></desc-wrapper>
            <z-card class="card-wrapper " justifyContent="center">
                <view class="card-content-item">
                    <view class="card-content_right flex-1">
                        <view class="input-name-box">
                            <input class="input-item" v-model="form.shuzi" type="text" placeholder="请输入任意数字" />
                        </view>
                    </view>
                </view>
            </z-card>
            <view class="bottom-btns">
                <view class="start-btn" @click="onClick_1">
                    <text class="">立即测算</text>
                </view>
                <!-- <view class="contact-btn"></view> -->
            </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            title: '数字吉凶',
            desc: '测试方法：随机输入任意一个数字，点击立即测算，并查看测算结果，请自行体会其中的吉凶指示。',
            form: {
                shuzi: ''
            }
        }
    },
    methods: {
        onClick_1() {
            let that = this
            if (this.form.shuzi == '') {
                this.$u.toast('请输入任意数字')
                return
            }
            uni.request({
                url: 'https://cs.appzdm.com:3000/Jixiong/shuzi',
                method: 'POST',
                header: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                },
                data: this.form,
                success: (res) => {
                    uni.navigateTo({
                        url: `/pages/shuzijixiong/detail?params=${JSON.stringify(res.data.data)}`
                    })
                },
                fail: (error) => {
                    console.error('Request Failed:', error)
                }
            })
        }
    }
}
</script>
<style lang="scss" scoped></style>
